package JDBC;
import java.sql.*;

public class CmsDatabaseConnection{
	
	public Connection connection;
	private ResultSet resultSet;
	private PreparedStatement preparedStatement;
	
	public CmsDatabaseConnection(){
		try{
		     Class.forName("com.mysql.jdbc.Driver");
		     System.out.println("DriverLoad");

		     connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/dbcms","root","");
		     System.out.println("Connection established");
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		    
	}
	
	
	public void close(){
		try{
			connection.close();
		}
		catch(Exception e){
		}
	}
	
	public ResultSet getResultSet() {
		return resultSet;
	}

	public PreparedStatement getPreparedStatement() {
		return preparedStatement;
	}

	public Connection getConnection() {
		return connection;
	}


	
}

